//
//  CheckInfoCell.m
//  掌上宏力
//
//  Created by admin on 2017/5/15.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "CheckInfoCell.h"
#import "CheckInfoFrame.h"
#import "CheckInfoModel.h"

@interface CheckInfoCell ()

@property(nonatomic,weak) UILabel *exam_nameLab;
@property (nonatomic,weak) UILabel *physicianLab;
@property (nonatomic,weak) UILabel *reporterLab;
@property (nonatomic,weak) UILabel *costsLab;
@property (nonatomic,weak) UILabel *clin_sympLab;
@property (nonatomic,weak) UILabel *phys_signLab;

@end


@implementation CheckInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        UILabel *exam_nameLab = [[UILabel alloc] init];
        [self.contentView addSubview:exam_nameLab];
        self.exam_nameLab = exam_nameLab;
        
        UILabel *physicianLab = [[UILabel alloc] init];
        physicianLab.font = kFont(15);
        [self.contentView addSubview:physicianLab];
        self.physicianLab = physicianLab;
        
        UILabel *reporterLab = [[UILabel alloc] init];
        reporterLab.font = kFont(15);
        [self.contentView addSubview:reporterLab];
        self.reporterLab = reporterLab;
        
        UILabel *costsLab = [[UILabel alloc] init];
        costsLab.font = kFont(15);
        [self.contentView addSubview:costsLab];
        self.costsLab = costsLab;
        
        UILabel *clins_sympLab = [[UILabel alloc] init];
        clins_sympLab.numberOfLines = 0;
        clins_sympLab.font = kFont(14);
        [self.contentView addSubview:clins_sympLab];
        self.clin_sympLab = clins_sympLab;
        
        UILabel *phys_signLab = [[UILabel alloc] init];
        phys_signLab.numberOfLines = 0;
        phys_signLab.font = kFont(14);
        [self.contentView addSubview:phys_signLab];
        self.phys_signLab = phys_signLab;
    }
    return self;
}

-(void)setCheckInfoFrame:(CheckInfoFrame *)checkInfoFrame{
    _checkInfoFrame = checkInfoFrame;
    
    [self settingData];
    
    [self settingFrame];
}
-(void)settingData{
    CheckInfoModel *checkInfo = self.checkInfoFrame.checkInfo;
    self.exam_nameLab.text = [NSString stringWithFormat:@"%@（%@）",checkInfo.exam_name,checkInfo.exam_sub_name];
    self.physicianLab.text = [NSString stringWithFormat:@"医生：%@",checkInfo.physician];
    self.reporterLab.text = [NSString stringWithFormat:@"操作员：%@",checkInfo.reporter];
    self.costsLab.text = [NSString stringWithFormat:@"费用：%@ 元",checkInfo.costs];
    self.clin_sympLab.text = [NSString stringWithFormat:@"    %@",checkInfo.clin_symp];
    self.phys_signLab.text = [NSString stringWithFormat:@"    %@",checkInfo.phys_sign];
}
-(void)settingFrame{
    self.exam_nameLab.frame = self.checkInfoFrame.exam_nameF;
    self.physicianLab.frame = self.checkInfoFrame.physicianF;
    self.reporterLab.frame = self.checkInfoFrame.reporterF;
    self.costsLab.frame = self.checkInfoFrame.costsF;
    self.clin_sympLab.frame = self.checkInfoFrame.clin_sympF;
    self.phys_signLab.frame = self.checkInfoFrame.phys_signF;
}
+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellId = @"checkInfo";
    CheckInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[CheckInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
